require("../../common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "pagesA/pages/shopA/detail" ], {
    "5b03": function(e, t, n) {
        n.r(t);
        var a, o = n("cdc7"), i = n("98c2");
        for (a in i) "default" !== a && function(e) {
            n.d(t, e, function() {
                return i[e];
            });
        }(a);
        n("eef5");
        var c = n("f0c5"), o = Object(c.a)(i.default, o.b, o.c, !1, null, null, null, !1, o.a, void 0);
        t.default = o.exports;
    },
    "7cb8": function(e, t, n) {},
    "841f": function(e, n, a) {
        (function(o) {
            Object.defineProperty(n, "__esModule", {
                value: !0
            }), n.default = void 0;
            var e, i = (e = a("a34a")) && e.__esModule ? e : {
                default: e
            };
            function u(e, t, n, a, o, i, c) {
                try {
                    var r = e[i](c), u = r.value;
                } catch (e) {
                    return n(e), 0;
                }
                r.done ? t(u) : Promise.resolve(u).then(a, o);
            }
            var c = getApp(), s = a("5f91"), t = {
                data: function() {
                    return {
                        module_name: c.globalData.module_name,
                        showAlert_login: !1,
                        userinfo: o.getStorageSync("userinfo"),
                        setting: o.getStorageSync("setting"),
                        wxCode: "",
                        systemtype: "",
                        detail: null,
                        mainHeight: 300,
                        pageLoading: !0,
                        showWechat: !1,
                        showshare: !1,
                        showAlert: !1,
                        paper: "",
                        demoHtml: "",
                        authorize: !1,
                        navItems: [ "商品详情" ],
                        active: 0
                    };
                },
                components: {
                    gracePage: function() {
                        a.e("graceUI/components/gracePage").then(function() {
                            return resolve(a("1021"));
                        }.bind(null, a)).catch(a.oe);
                    },
                    graceNavBar: function() {
                        a.e("graceUI/components/graceNavBar").then(function() {
                            return resolve(a("a631"));
                        }.bind(null, a)).catch(a.oe);
                    },
                    graceShade: function() {
                        a.e("graceUI/components/graceShade").then(function() {
                            return resolve(a("31ed"));
                        }.bind(null, a)).catch(a.oe);
                    },
                    graceDialog: function() {
                        a.e("graceUI/components/graceDialog").then(function() {
                            return resolve(a("f85d"));
                        }.bind(null, a)).catch(a.oe);
                    },
                    graceBottomDialog: function() {
                        a.e("graceUI/components/graceBottomDialog").then(function() {
                            return resolve(a("f7a1"));
                        }.bind(null, a)).catch(a.oe);
                    },
                    graceLoading: function() {
                        a.e("graceUI/components/graceLoading").then(function() {
                            return resolve(a("1d04"));
                        }.bind(null, a)).catch(a.oe);
                    },
                    graceAnalysis: function() {
                        a.e("graceUI/components/graceAnalysis").then(function() {
                            return resolve(a("b6ee"));
                        }.bind(null, a)).catch(a.oe);
                    }
                },
                props: {},
                onShow: function() {
                    o.hideLoading();
                },
                onShareAppMessage: function() {
                    var e = "pagesA/shopA/detail?uid=" + o.getStorageSync("userinfo").user_id + "&item_id=" + this.item_id;
                    return {
                        title: detail.title,
                        imageUrl: detail.photos[0],
                        path: e
                    };
                },
                onLoad: function(n) {
                    var r, a = this;
                    return r = i.default.mark(function e() {
                        var t;
                        return i.default.wrap(function(e) {
                            for (;;) switch (e.prev = e.next) {
                              case 0:
                                return e.next = 2, a.$onLaunched;

                              case 2:
                                (t = a).setting = o.getStorageSync("setting"), t.tabBar = o.getStorageSync("tabbar"), 
                                t.userinfo = o.getStorageSync("userinfo"), o.hideLoading(), a.item_id = n.item_id, 
                                t = c.globalData.util.url("entry/wxapp/api", {
                                    m: c.globalData.module_name,
                                    o: "item"
                                }), o.request({
                                    url: t,
                                    method: "POST",
                                    data: {
                                        item_id: a.item_id,
                                        openid: o.getStorageSync("openid")
                                    },
                                    header: {
                                        "content-type": "application/x-www-form-urlencoded"
                                    },
                                    success: function(e) {
                                        1 == e.data.status ? (e = c.globalData.crypt.Decrypt(e.data.data.data, e.data.data.key), 
                                        e = JSON.parse(e), a.detail = e.detail, a.demoHtml = s.format(a.detail.details2)) : (o.showToast({
                                            title: "网络请求失败"
                                        }), o.navigateBack({
                                            delta: 1
                                        })), o.hideLoading();
                                    }
                                });

                              case 12:
                              case "end":
                                return e.stop();
                            }
                        }, e);
                    }), function() {
                        var e = this, c = arguments;
                        return new Promise(function(t, n) {
                            var a = r.apply(e, c);
                            function o(e) {
                                u(a, t, n, o, i, "next", e);
                            }
                            function i(e) {
                                u(a, t, n, o, i, "throw", e);
                            }
                            o(void 0);
                        });
                    }();
                },
                methods: {
                    backHome: function() {
                        o.navigateTo({
                            url: "../../../pages/index/index"
                        });
                    },
                    myitemorder: function() {
                        o.navigateTo({
                            url: "../../../pages/user/creditorder"
                        });
                    },
                    tapToOrder: function() {
                        var e, n = this, a = 0 < n.detail.market_price ? (e = "是否确认购买", "购买成功") : (e = "是否确认兑换", 
                        "兑换成功");
                        o.showModal({
                            title: "提示",
                            content: e,
                            showCancel: !0,
                            success: function(e) {
                                e.confirm && wx.chooseAddress({
                                    success: function(e) {
                                        var t = c.globalData.util.url("entry/wxapp/api", {
                                            m: c.globalData.module_name,
                                            o: "plan"
                                        });
                                        o.request({
                                            url: t,
                                            method: "GET",
                                            data: {
                                                item_id: n.item_id,
                                                openid: o.getStorageSync("openid"),
                                                userName: e.userName,
                                                provinceName: e.provinceName,
                                                cityName: e.cityName,
                                                countyName: e.countyName,
                                                detailInfo: e.detailInfo,
                                                telNumber: e.telNumber
                                            },
                                            success: function(e) {
                                                1 == e.data.status ? o.showModal({
                                                    title: "提示",
                                                    content: a,
                                                    showCancel: !1,
                                                    success: function(e) {
                                                        e.confirm && wx.requestSubscribeMessage({
                                                            tmplIds: o.getStorageSync("setting").item_tplid,
                                                            success: function(e) {
                                                                o.showToast({
                                                                    title: "订阅成功",
                                                                    icon: "none"
                                                                }), o.redirectTo({
                                                                    url: "../../../pages/user/creditorder"
                                                                });
                                                            },
                                                            fail: function(e) {
                                                                o.showToast({
                                                                    title: "您已取消订阅",
                                                                    icon: "none"
                                                                }), o.redirectTo({
                                                                    url: "../../../pages/user/creditorder"
                                                                });
                                                            }
                                                        });
                                                    }
                                                }) : 2 == e.data.status ? c.globalData.util.request({
                                                    url: "entry/wxapp/pay",
                                                    data: {
                                                        m: c.globalData.module_name,
                                                        type: "item",
                                                        order_id: e.data.order_id
                                                    },
                                                    cachetime: 0,
                                                    success: function(e) {
                                                        e.data && e.data.data && !e.data.errno && wx.requestPayment({
                                                            timeStamp: e.data.data.timeStamp,
                                                            nonceStr: e.data.data.nonceStr,
                                                            package: e.data.data.package,
                                                            signType: "MD5",
                                                            paySign: e.data.data.paySign,
                                                            success: function(e) {
                                                                o.showModal({
                                                                    title: "系统提示",
                                                                    content: "支付成功",
                                                                    showCancel: !1,
                                                                    success: function(e) {
                                                                        e.confirm && wx.requestSubscribeMessage({
                                                                            tmplIds: o.getStorageSync("setting").item_tplid,
                                                                            success: function(e) {
                                                                                o.showToast({
                                                                                    title: "订阅成功",
                                                                                    icon: "none"
                                                                                }), o.redirectTo({
                                                                                    url: "../../../pages/user/creditorder"
                                                                                });
                                                                            },
                                                                            fail: function(e) {
                                                                                o.showToast({
                                                                                    title: "您已取消订阅",
                                                                                    icon: "none"
                                                                                }), o.redirectTo({
                                                                                    url: "../../../pages/user/creditorder"
                                                                                });
                                                                            }
                                                                        });
                                                                    }
                                                                });
                                                            },
                                                            fail: function(e) {
                                                                o.showModal({
                                                                    title: "系统提示",
                                                                    content: "支付失败",
                                                                    showCancel: !1
                                                                });
                                                            }
                                                        });
                                                    },
                                                    fail: function(e) {
                                                        o.showModal({
                                                            title: "系统提示",
                                                            content: e.data.message || "错误",
                                                            showCancel: !1,
                                                            success: function(e) {}
                                                        });
                                                    }
                                                }) : o.showToast({
                                                    title: e.data.msg,
                                                    icon: "none"
                                                });
                                            }
                                        });
                                    },
                                    fail: function(e) {
                                        o.showToast({
                                            title: "您已取消",
                                            icon: "none"
                                        });
                                    }
                                });
                            }
                        });
                    }
                }
            };
            n.default = t;
        }).call(this, a("543d").default);
    },
    "98c2": function(e, t, n) {
        n.r(t);
        var a, o = n("841f"), i = n.n(o);
        for (a in o) "default" !== a && function(e) {
            n.d(t, e, function() {
                return o[e];
            });
        }(a);
        t.default = i.a;
    },
    b8b5: function(e, t, n) {
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            n("0cda"), t(n("66fd")), e(t(n("5b03")).default);
        }).call(this, n("543d").createPage);
    },
    cdc7: function(e, t, n) {
        n.d(t, "b", function() {
            return a;
        }), n.d(t, "c", function() {
            return o;
        }), n.d(t, "a", function() {});
        var a = function() {
            this.$createElement;
            this._self._c;
        }, o = [];
    },
    eef5: function(e, t, n) {
        var a = n("7cb8");
        n.n(a).a;
    }
}, [ [ "b8b5", "common/runtime", "common/vendor" ] ] ]);